﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit_class_model.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Class.edit_class_model" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<body>
    <%
        int id = int.Parse(Request.QueryString["id"]);
        var get_cls = new TblClassController().FetchAll().Where(x => x.Id == id).Single();
        
    %>
    
    <div class="w3-modal-content w3-animate-top w3-card-8 w3-teal w3-padding" style="width: 50%">  
        <header class="w3-padding w3-center">
            <span onclick="this.parentElement.parentElement.parentElement.style.display='none'" class="w3-closebtn">&times;</span>
            <p class="w3-large">Chỉnh sửa lớp</p>
        </header>
        <div class="w3-padding-bottom w3-row w3-hide">
            <input type="text" id="edit_class_id" value="<%=get_cls.Id %>"/>
        </div>
        <div class="w3-padding-bottom w3-row">
            <label class="w3-quarter">Tên lớp</label><input type="text" id="edit_class_name" value="<%=get_cls.ClassName %>" required="required" placeholder="Nhập tên lớp" autofocus="autofocus" class="class-editor w3-half" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Giáo viên</label>
            <select id="ddl_edit_teacher" class="class-editor w3-half">
                <%foreach (TblManager teacher in new TblManagerController().FetchAll().Where(x => x.Role == 2))
                  {
                      if (teacher.ManagerId == get_cls.Teacher)
                      {%>
                <option selected="selected" value="<%=teacher.ManagerId %>"><%=teacher.FullName %></option>
                <%}
                      else
                      { %>
                <option value="<%=teacher.ManagerId %>"><%=teacher.FullName %></option>
                <%}
                  }%>
            </select>
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Ngày khai giảng</label>
            <input type="date" id="edit_open_date" value="<%=open %>" required="required" autofocus="autofocus" class="class-editor w3-half" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Ngày tốt nghiệp</label>
            <input type="date" id="edit_close_date" value="<%=close %>" required="required" autofocus="autofocus" class="class-editor w3-half" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Hình thức</label>
            <input type="text" id="edit_class_type" value="<%=get_cls.Degree %>" required="required" autofocus="autofocus" placeholder="Nhập hình thức học" class="class-editor w3-half" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Lịch học</label>
            <div class="checkbox w3-half">
                <%if (mon == true)
                  {%>
                <input checked="checked" type="checkbox" value="1" id="edit_monday" /><label for="edit_monday">Thứ 2</label>&nbsp;<%}
                  else
                  { %>
                <input type="checkbox" value="1" id="edit_monday" /><label for="edit_monday">Thứ 2</label>&nbsp;
                <%} %>
                <%if (tue == true)
                  { %>
                <input checked="checked" type="checkbox" value="2" id="edit_tuesday" /><label for="edit_tuesday">Thứ 3</label>&nbsp;<%}
                  else
                  { %>
                <input type="checkbox" value="2" id="edit_tuesday" /><label for="edit_tuesday">Thứ 3</label>&nbsp;
                <%} %>
                <%if (wed == true)
                  {%>
                <input checked="checked" type="checkbox" value="3" id="edit_wednesday" /><label for="edit_wednesday">Thứ 4</label><br />
                <%}
                  else
                  { %>
                <input type="checkbox" value="3" id="edit_wednesday" /><label for="edit_wednesday">Thứ 4</label><br />
                <%} %>
                <%if (thu == true)
                  { %>
                <input checked type="checkbox" value="4" id="edit_thursday" /><label for="edit_thursday">Thứ 5</label>&nbsp;
                <%}
                  else
                  { %>
                <input type="checkbox" value="4" id="edit_thursday" /><label for="edit_thursday">Thứ 5</label>&nbsp;
                <%} %>
                <%if (fri == true)
                  { %>
                <input checked="checked" type="checkbox" value="5" id="edit_friday" /><label for="edit_friday">Thứ 6</label>&nbsp;
                <%}
                  else
                  { %>
                <input type="checkbox" value="5" id="edit_friday" /><label for="edit_friday">Thứ 6</label>&nbsp;
                <%} %>
                <%if (sat == true)
                  {%>
                <input checked="checked" type="checkbox" value="6" id="edit_saturday" /><label for="edit_saturday">Thứ 7</label>
                <%}
                  else
                  { %>
                <input type="checkbox" value="6" id="edit_saturday" /><label for="edit_saturday">Thứ 7</label>
                <%} %>
            </div>
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Sáng</label><input type="time" id="edit_morning_from" value="<%=morning1 %>" class="class-editor w3-col l3" /><label class="w3-col l2 w3-padding">Đến</label><input type="time" id="edit_morning_to" value="<%=morning2 %>" class="class-editor w3-col l3" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Chiều</label><input type="time" id="edit_afternoon_from" value="<%=afternoon1 %>" class="class-editor w3-col l3" /><label class="w3-col l2 w3-padding">Đến</label><input type="time" id="edit_afternoon_to" value="<%=afternoon2 %>" class="class-editor w3-col l3" />
        </div>
        <div class="w3-row w3-padding-bottom">
            <label class="w3-quarter">Tối</label><input type="time" id="edit_evening_from" value="<%=evening1 %>" class="class-editor w3-col l3" /><label class="w3-col l2 w3-padding">Đến</label><input type="time" id="edit_evening_to" value="<%=evening2 %>" class="class-editor w3-col l3" />
        </div>
        <div class="w3-padding-bottom w3-row">
            <label class="w3-quarter">Bài học</label><textarea id="txta_edit_lession" required="required" placeholder="Nhập bài đang học" autofocus="autofocus" class="class-editor w3-half" cols="3"><%=get_cls.Lesson %></textarea>
        </div>
        <div class="w3-padding-bottom w3-row">
            <label class="w3-quarter">Trình độ</label><input type="text" id="edit_degree" value="<%=get_cls.ClsLevel %>" required="required" placeholder="Nhập trình độ" autofocus="autofocus" class="class-editor w3-half" />
        </div>
        <div class="w3-padding-bottom w3-row">
            <label class="w3-quarter">Đóng/Mở</label>
            <%if(get_cls.Active==true){ %>
            <i class="active_class fa fa-toggle-on w3-xlarge w3-text-white w3-animate-opacity "></i>
            <%}else{ %>
            <i class="active_class fa fa-toggle-on w3-xlarge w3-text-red w3-animate-opacity fa-rotate-180 off "></i>
            <%} %>
        </div>
        <div class="w3-row w3-padding-bottom w3-center">
            <a class="btn_edited_class w3-btn w3-teal w3-border w3-border-white"><i class="fa fa-save"></i>&nbsp;Lưu</a>
        </div>
    </div>
</body>
</html>
